<!DOCTYPE html>
<html lang="en">
<div th:replace="${info.meta}"></div>
<body>

<div id="logBar" class="bg">
    <div class="log-bar">
        <div class="title"></div>
        <div class="tr1">
            <div class="field1">账号：</div>
            <div class="value1">
                <input type="text" id="username" class="input1" placeholder="请输入用户名" onkeypress="enterPress(event)" />
            </div>
        </div>
        <div class="tr1">
            <div class="field1">密码：</div>
            <div class="value1">
                <input type="password" id="password" class="input1" placeholder="请输入密码" onkeypress="enterPress(event)" />
            </div>
        </div>
        <div class="tr1">
            <div class="button1" onclick="login()">确定</div>
        </div>
    </div>
</div>

<script>
    function login() {
        var publicKey = `-----BEGIN PUBLIC KEY-----MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAvxfQNOmJzjem+q7PxpKqHTLUFJnijsp2Ujm0kN/UcZ1kFVJH8Qd0YquEyRp7jYn51UeoikbQ3KOzuG55zgE08MDeJI6YuXHSNv7LhcbTnXftloCOk2Ooynj5C6gdrCSFqUpN5XW4jcSdzK/H9Ec8q4TUpkku+/GzAPvsSAD+nQD9gaOl6Vs4LqSKPPWq6YiqV7PvZgUX0MLOo4LkJjti+KIyQXSN56DfgV8rJd0BkuVQtkVMx/7NA8JDloviJgaGEyE60NRzNZUp1b+L8XarY1RANgdRFMV8JaDI1k4vh7FIHrnKYCrVFRBl28wiKuk/F6KoblB9E/IYof59V0uGrwIDAQAB-----END PUBLIC KEY-----`;

        var encrypt = new JSEncrypt();
        encrypt.setPublicKey(publicKey);

        var data = "周末去南宁";
        var result = encrypt.encrypt(data);
        console.log(result);
    }
</script>

</body>
</html>